/**
 * Created by ybjaa on 2016/5/2.
 */


console.log("我看看有没有塞进去");

/**
* 发送事件
*/
chrome.extension.sendRequest({testSend: "这是发送数据"}, function(response) {
    console.log(response.message);
});



/**
 * 接收事件
 */
chrome.extension.onRequest.addListener(
    function(request, sender, sendResponse) {
        console.log(sender);
        /*console.log(sender.tab ?
        "from a content script:" + sender.tab.url :
            "from the extension");
        console.log(request);
        if (request.type == "testSelectTab")
            sendResponse({type:"ReceiveSuccess",message:"数据接收成功"});
        else
            sendResponse({}); // snub them.*/
    });

/**
 * 收到背景代码的事件
 */
chrome.runtime.onMessage.addListener(function(request, sender, sendRequest) {
    console.log("接收选项卡收到的事件??");
    console.log(request);
    console.log(sender);
    console.log(sendRequest);
    var m1=document.getElementById("s_tab");
    $(m1).background;
    console.log(m1);
});

